home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / lang / SmallEiffel.lha / SmallEiffel / lib_se / run_feature_10.e < prev    next >
Text File  |  1998-12-22  |  4KB  |  171 lines

  1. --          This file is part of SmallEiffel The GNU Eiffel Compiler.
  2. --          Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
  3. --            Dominique COLNET and Suzanne COLLIN - colnet@loria.fr 
  4. --                       http://www.loria.fr/SmallEiffel
  5. -- SmallEiffel is  free  software;  you can  redistribute it and/or modify it 
  6. -- under the terms of the GNU General Public License as published by the Free
  7. -- Software  Foundation;  either  version  2, or (at your option)  any  later 
  8. -- version. SmallEiffel is distributed in the hope that it will be useful,but
  9. -- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. -- or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU General Public License 
  11. -- for  more  details.  You  should  have  received a copy of the GNU General 
  12. -- Public  License  along  with  SmallEiffel;  see the file COPYING.  If not,
  13. -- write to the  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. -- Boston, MA 02111-1307, USA.
  15. --
  16. class RUN_FEATURE_10
  17.  
  18. inherit RUN_FEATURE redefine base_feature end;
  19.  
  20. creation {E_PRECURSOR_PROCEDURE} make
  21.  
  22. feature
  23.  
  24.    base_feature: PROCEDURE;
  25.  
  26.    arguments: FORMAL_ARG_LIST;
  27.  
  28.    local_vars: LOCAL_VAR_LIST;
  29.  
  30.    routine_body: COMPOUND;
  31.    
  32.    rescue_compound: COMPOUND;
  33.  
  34. feature
  35.    
  36.    is_static: BOOLEAN is false;
  37.  
  38.    is_pre_computable: BOOLEAN is false;
  39.  
  40.    can_be_dropped: BOOLEAN is false;
  41.  
  42.    is_once_function: BOOLEAN is false;
  43.  
  44. feature
  45.  
  46.    result_type: TYPE is
  47.       do
  48.       end;
  49.  
  50.    static_value_mem: INTEGER is
  51.       do
  52.       end;
  53.  
  54.    afd_check is
  55.       do
  56.      routine_afd_check;
  57.       end;
  58.  
  59.    mapping_c is
  60.       do
  61.      default_mapping_procedure;
  62.       end;
  63.    
  64.    c_define is
  65.       do
  66.      if use_current then
  67.         cpp.incr_procedure_count;
  68.      else
  69.         cpp.incr_real_procedure_count;
  70.      end;
  71.      define_prototype;
  72.      c_define_opening;
  73.      if routine_body /= Void then
  74.         routine_body.compile_to_c;
  75.      end;
  76.      c_define_closing;
  77.      cpp.put_string(fz_12);
  78.      c_frame_descriptor;
  79.       end;
  80.    
  81. feature {RUN_CLASS}
  82.  
  83.    jvm_field_or_method is
  84.       do
  85.      jvm.add_method(Current);
  86.       end;
  87.  
  88. feature
  89.  
  90.    mapping_jvm is
  91.       do
  92.      routine_mapping_jvm;
  93.       end;
  94.  
  95. feature {JVM}
  96.  
  97.    jvm_define is
  98.       do
  99.      method_info_start;
  100.      jvm_define_opening;
  101.      if routine_body /= Void then
  102.         routine_body.compile_to_jvm;
  103.      end;
  104.      jvm_define_closing;
  105.      code_attribute.opcode_return;
  106.      method_info.finish;
  107.       end;
  108.    
  109. feature {NONE}
  110.  
  111.    update_tmp_jvm_descriptor is
  112.       do
  113.      routine_update_tmp_jvm_descriptor;
  114.       end;
  115.  
  116. feature {CALL_PROC_CALL}
  117.  
  118.    collect_c_tmp is
  119.       do
  120.       end;
  121.  
  122. feature {ADDRESS_OF_POOL}
  123.  
  124.    address_of_c_define(caller: ADDRESS_OF) is
  125.       do
  126.       end;
  127.  
  128. feature {ADDRESS_OF}
  129.    
  130.    address_of_c_mapping is
  131.       do
  132.       end;
  133.  
  134. feature {NONE}   
  135.    
  136.    compute_use_current is
  137.       do
  138.      std_compute_use_current;
  139.       end;
  140.  
  141.    initialize is
  142.       do
  143.      arguments := base_feature.arguments;
  144.      if arguments /= Void then
  145.         if not arguments.is_runnable(current_type) then
  146.            !!arguments.with(arguments,current_type);
  147.         end;
  148.      end;
  149.      local_vars := base_feature.local_vars;
  150.      if local_vars /= Void then
  151.         local_vars := local_vars.to_runnable(current_type);
  152.      end;
  153.      routine_body := base_feature.routine_body;
  154.      if routine_body /= Void then
  155.         routine_body := routine_body.to_runnable(current_type);
  156.      end;
  157.      if run_control.require_check then
  158.         require_assertion := base_feature.run_require(Current);
  159.      end;
  160.      if run_control.ensure_check then
  161.         ensure_assertion := base_feature.run_ensure(Current);
  162.      end;
  163.      rescue_compound := base_feature.rescue_compound;
  164.      if rescue_compound /= Void then
  165.         exceptions_handler.set_used;
  166.         rescue_compound := rescue_compound.to_runnable(current_type);
  167.      end;
  168.       end;
  169.  
  170. end -- RUN_FEATURE_10
  171.